package calender;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author wxc
 * @Date 2021/4/16 15:59
 */
public class demo03 {
    public static void main(String[] args) throws ParseException {
        String string = "2021-04-20 09:06:01";
        String string1 = "2021-04-20 09:36:01";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String s = String.valueOf(string);
        Date parse = simpleDateFormat.parse(string);
        Date parse1 = simpleDateFormat.parse(string1);
        System.out.println(string);
        long time = parse.getTime();
        System.out.println(time);
        int a = 30;
        long addTime = 30 * 60 * 1000;
        long total = parse.getTime() + addTime;
        System.out.println(total);
        System.out.println(parse1.getTime());
    }
}
